package com.zy.yygh.hosp.controller;

import com.zy.yygh.common.result.Result;
import com.zy.yygh.hosp.service.DepartmentService;
import com.zy.yygh.model.hosp.Department;
import com.zy.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
//@CrossOrigin
@RequestMapping("/admin/hosp/department")
@Api(tags = "科室管理")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDepList(@PathVariable String hoscode){
        List<DepartmentVo>list=departmentService.findDepTree(hoscode);
        return Result.ok(list);
    }
}
